refactor(lsp-util): Update LSP client and jump utility calls #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Origin:
LSP client methods used inconsistent calling syntax internally, potentially leading to inaccurate
selfpassing. The jump functionality utilizedvim.lsp.util.jump_to_location, which is not the latest or recommended interface for the Neovim LSP API.Solution:
Standardize all LSP client method calls in
litee.lib.lspto Lua's colon syntax (client:method(...)) to ensure correctselfpropagation. Inlitee.lib.jumps, replacevim.lsp.util.jump_to_locationwithvim.lsp.util.show_documentto adopt Neovim LSP's more modern and flexible document display interface.Impact:
• For users: No apparent direct functional behavior changes. • For developers: Improves internal code consistency and maintainability, adhering to Neovim LSP API best practices. • Potential risks: Limited risk, mainly internal API call adjustments; should have no functional regression after testing.
Key Changes:
• Replaced
jump_to_locationwithshow_documentin thejump_invokingfunction inlua/litee/lib/jumps/init.lua. • Changedclient.supports_methodandclient.requestcalls to colon syntax inM.multi_client_requestinlua/litee/lib/lsp/init.lua. • Changedclient.supports_methodandclient.request_synccalls to colon syntax inM.symbol_from_nodeinlua/litee/lib/lsp/init.lua.